package com.gurumades.jsonform.client;

import com.google.gwt.json.client.JSONObject;

public class JSONUtils {
	public static String getString(String key, JSONObject o) {
		if (o.containsKey(key) && o.get(key).isString() != null) {
			return o.get(key).isString().stringValue();
		}
		return null;
	}
	
	public static boolean getBoolean(String key, JSONObject o) {
		if (o.containsKey(key) && o.get(key).isBoolean() != null) {
			return o.get(key).isBoolean().booleanValue();
		}
		return false;
	}
}
